import request from "../request";

const homeApi = {
  getSourceList(){
    return request({
      method:'GET',
      url: '/api/source/getList'
    })
  },
  userLogin({
    userName,
    password
  }){
    return request({
      method:'POST',
      url: '/api/login',
      data:{
        userName,
        password
      }
    })
  },
  userRegister({
    userName,
    password,
    nickname,
    sex,
    birthday,
    phoneNumber,
    email
  }){
    return request({
      method:'POST',
      url: '/api/register',
      data:{
        userName,
        password,
        nickname,
        sex,
        birthday,
        phoneNumber,
        email
      }
    })
  },
  getUserInfo(){
    return request({
      method:'post',
      url: '/api/user/getUserInfo'
    })
  },
  updateUserInfo(formData){
    return request({
      method:'post',
      url: '/api/user/updateUserInfo',
      data:formData
    })
  },
  uploadAvatar(formData){
    return request({
      method:'post',
      url: '/api/user/uploadAvatar',
      data:formData
    })
  },
}


export default homeApi
